#pragma once

#include "ZMessageController.h"
#include "ZGameMessage.h"
#include "ZStream.h"

namespace	Z	{

//------------------------------------------------------------------------------------------------------------------------
template<typename Fetcher, typename Builder>
class GameMessageController
	:	public MessageController<Fetcher, Builder>
{
public:
	GameMessageController(NetworkController* pNetworkController, MessageHandler* pMessageHandler)
		:	MessageController(pNetworkController, pMessageHandler)	{
	}
	void	send(GameMessage& kMessage, NetworkId kNetworkId)	{
		Stream stream;
		stream << kMessage;
		MessageController::send(stream.getBuffer(), stream.size(), kNetworkId);
	}
	using	MessageController::send;
};

}